using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_UIComposite_TreeViewNode_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            MethodBase method;
            FieldInfo field;
            Type[] args;
            Type type = typeof(huqiang.UIComposite.TreeViewNode);
            args = new Type[]{};
            method = type.GetMethod("get_content", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, get_content_0);
            args = new Type[]{typeof(System.String)};
            method = type.GetMethod("set_content", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, set_content_1);
            args = new Type[]{typeof(huqiang.UIComposite.TreeViewNode)};
            method = type.GetMethod("Add", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Add_2);
            args = new Type[]{typeof(huqiang.UIComposite.TreeViewNode)};
            method = type.GetMethod("SetParent", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, SetParent_3);
            args = new Type[]{};
            method = type.GetMethod("GetSiblingIndex", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, GetSiblingIndex_4);
            args = new Type[]{typeof(System.Int32)};
            method = type.GetMethod("SetSiblingIndex", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, SetSiblingIndex_5);
            args = new Type[]{};
            method = type.GetMethod("get_parent", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, get_parent_6);
            args = new Type[]{};
            method = type.GetMethod("get_Level", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, get_Level_7);
            args = new Type[]{typeof(System.Int32[])};
            method = type.GetMethod("Find", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Find_8);
            args = new Type[]{};
            method = type.GetMethod("Expand", flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Expand_9);

            field = type.GetField("expand", flag);
            app.RegisterCLRFieldGetter(field, get_expand_0);
            app.RegisterCLRFieldSetter(field, set_expand_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_expand_0, AssignFromStack_expand_0);
            field = type.GetField("context", flag);
            app.RegisterCLRFieldGetter(field, get_context_1);
            app.RegisterCLRFieldSetter(field, set_context_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_context_1, AssignFromStack_context_1);
            field = type.GetField("offset", flag);
            app.RegisterCLRFieldGetter(field, get_offset_2);
            app.RegisterCLRFieldSetter(field, set_offset_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_offset_2, AssignFromStack_offset_2);
            field = type.GetField("child", flag);
            app.RegisterCLRFieldGetter(field, get_child_3);
            app.RegisterCLRFieldSetter(field, set_child_3);
            app.RegisterCLRFieldBinding(field, CopyToStack_child_3, AssignFromStack_child_3);


            app.RegisterCLRCreateDefaultInstance(type, () => new huqiang.UIComposite.TreeViewNode());
            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.UIComposite.TreeViewNode[s]);

            args = new Type[]{};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_0);

        }


        static StackObject* get_content_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIComposite.TreeViewNode instance_of_this_method = (huqiang.UIComposite.TreeViewNode)typeof(huqiang.UIComposite.TreeViewNode).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.content;

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static StackObject* set_content_1(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.String @value = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.UIComposite.TreeViewNode instance_of_this_method = (huqiang.UIComposite.TreeViewNode)typeof(huqiang.UIComposite.TreeViewNode).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.content = value;

            return __ret;
        }

        static StackObject* Add_2(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIComposite.TreeViewNode @node = (huqiang.UIComposite.TreeViewNode)typeof(huqiang.UIComposite.TreeViewNode).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.UIComposite.TreeViewNode instance_of_this_method = (huqiang.UIComposite.TreeViewNode)typeof(huqiang.UIComposite.TreeViewNode).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Add(@node);

            return __ret;
        }

        static StackObject* SetParent_3(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIComposite.TreeViewNode @node = (huqiang.UIComposite.TreeViewNode)typeof(huqiang.UIComposite.TreeViewNode).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.UIComposite.TreeViewNode instance_of_this_method = (huqiang.UIComposite.TreeViewNode)typeof(huqiang.UIComposite.TreeViewNode).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.SetParent(@node);

            return __ret;
        }

        static StackObject* GetSiblingIndex_4(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIComposite.TreeViewNode instance_of_this_method = (huqiang.UIComposite.TreeViewNode)typeof(huqiang.UIComposite.TreeViewNode).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.GetSiblingIndex();

            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static StackObject* SetSiblingIndex_5(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Int32 @index = ptr_of_this_method->Value;

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.UIComposite.TreeViewNode instance_of_this_method = (huqiang.UIComposite.TreeViewNode)typeof(huqiang.UIComposite.TreeViewNode).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.SetSiblingIndex(@index);

            return __ret;
        }

        static StackObject* get_parent_6(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIComposite.TreeViewNode instance_of_this_method = (huqiang.UIComposite.TreeViewNode)typeof(huqiang.UIComposite.TreeViewNode).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.parent;

            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static StackObject* get_Level_7(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIComposite.TreeViewNode instance_of_this_method = (huqiang.UIComposite.TreeViewNode)typeof(huqiang.UIComposite.TreeViewNode).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.Level;

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static StackObject* Find_8(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            System.Int32[] @level = (System.Int32[])typeof(System.Int32[]).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            huqiang.UIComposite.TreeViewNode instance_of_this_method = (huqiang.UIComposite.TreeViewNode)typeof(huqiang.UIComposite.TreeViewNode).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.Find(@level);

            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static StackObject* Expand_9(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* ptr_of_this_method;
            StackObject* __ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            huqiang.UIComposite.TreeViewNode instance_of_this_method = (huqiang.UIComposite.TreeViewNode)typeof(huqiang.UIComposite.TreeViewNode).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.Expand();

            return __ret;
        }


        static object get_expand_0(ref object o)
        {
            return ((huqiang.UIComposite.TreeViewNode)o).expand;
        }

        static StackObject* CopyToStack_expand_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.TreeViewNode)o).expand;
            __ret->ObjectType = ObjectTypes.Integer;
            __ret->Value = result_of_this_method ? 1 : 0;
            return __ret + 1;
        }

        static void set_expand_0(ref object o, object v)
        {
            ((huqiang.UIComposite.TreeViewNode)o).expand = (System.Boolean)v;
        }

        static StackObject* AssignFromStack_expand_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Boolean @expand = ptr_of_this_method->Value == 1;
            ((huqiang.UIComposite.TreeViewNode)o).expand = @expand;
            return ptr_of_this_method;
        }

        static object get_context_1(ref object o)
        {
            return ((huqiang.UIComposite.TreeViewNode)o).context;
        }

        static StackObject* CopyToStack_context_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.TreeViewNode)o).context;
            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance, true);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method, true);
        }

        static void set_context_1(ref object o, object v)
        {
            ((huqiang.UIComposite.TreeViewNode)o).context = (System.Object)v;
        }

        static StackObject* AssignFromStack_context_1(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Object @context = (System.Object)typeof(System.Object).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.UIComposite.TreeViewNode)o).context = @context;
            return ptr_of_this_method;
        }

        static object get_offset_2(ref object o)
        {
            return ((huqiang.UIComposite.TreeViewNode)o).offset;
        }

        static StackObject* CopyToStack_offset_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.TreeViewNode)o).offset;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_offset_2(ref object o, object v)
        {
            ((huqiang.UIComposite.TreeViewNode)o).offset = (UnityEngine.Vector2)v;
        }

        static StackObject* AssignFromStack_offset_2(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            UnityEngine.Vector2 @offset = (UnityEngine.Vector2)typeof(UnityEngine.Vector2).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)16);
            ((huqiang.UIComposite.TreeViewNode)o).offset = @offset;
            return ptr_of_this_method;
        }

        static object get_child_3(ref object o)
        {
            return ((huqiang.UIComposite.TreeViewNode)o).child;
        }

        static StackObject* CopyToStack_child_3(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.UIComposite.TreeViewNode)o).child;
            object obj_result_of_this_method = result_of_this_method;
            if(obj_result_of_this_method is CrossBindingAdaptorType)
            {    
                return ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance);
            }
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_child_3(ref object o, object v)
        {
            ((huqiang.UIComposite.TreeViewNode)o).child = (System.Collections.Generic.List<huqiang.UIComposite.TreeViewNode>)v;
        }

        static StackObject* AssignFromStack_child_3(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Collections.Generic.List<huqiang.UIComposite.TreeViewNode> @child = (System.Collections.Generic.List<huqiang.UIComposite.TreeViewNode>)typeof(System.Collections.Generic.List<huqiang.UIComposite.TreeViewNode>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.UIComposite.TreeViewNode)o).child = @child;
            return ptr_of_this_method;
        }



        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);

            var result_of_this_method = new huqiang.UIComposite.TreeViewNode();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


    }
}
